/*
 * @Description: 销毁
 * @Author: Zzt
 * @Date: 2023-01-16 16:48:25
 * @LastEditTime: 2023-01-16 16:55:53
 */
import { destroyArchive } from '@/api/archives/archives';
import { Button } from 'antd';

const Destroy = (props: any) => {
  const { selectItems, baseInfo } = props;
  const DestroyFile = () => {
    const coordinate = {
      atCode: baseInfo.atCode,
      atType: baseInfo.atType,
      level: baseInfo.atLevel
    };
    const movingEntryInfo = {
      entryIdList: selectItems
    };
    destroyArchive({ coordinate, movingEntryInfo, dbName: baseInfo.dbName });
  };
  return (
    <>
      <Button
        disabled={selectItems.length === 0}
        onClick={() => DestroyFile()}
        style={{ width: '100%' }}
      >
        销毁
      </Button>
    </>
  );
};
export default Destroy;
